<template>
	<view>
		<view class="head">
			<view class="head_left" @tap="back()">
				<image src="../../../static/wode/return.png" mode=""></image>
				<text>返回</text>
			</view>
			<view class="head_mid">
				账户与安全
			</view>
			<view class="head_right">

			</view>
		</view>
		<view class="body_item" style="margin-top: 20upx;" @tap="toChangeNum('phone')" v-if="loginName==''">
			<text>手机绑定</text>
			<view class="body_item_right">
				<text>未绑定</text>
				<image src="../../../static/wode/arrow_right.png" mode=""></image>
			</view>
		</view>
		<view class="body_item" @tap="toPhoneNumber('phone')" v-else>
			<text>手机绑定</text>
			<view class="body_item_right">
				<text>{{loginName}}</text>
				<image src="../../../static/wode/arrow_right.png" mode=""></image>
			</view>
		</view>
		<view class="body_item" @tap="tosetPass">
			<text>设置密码</text>
			<view class="body_item_right">
				<text></text>
				<image src="../../../static/wode/arrow_right.png" mode=""></image>
			</view>
		</view>
		<view class="body_item" @tap="toChangeNum('email')" v-if="email==''">
			<text>邮箱地址</text>
			<view class="body_item_right">
				<text>未绑定</text>
				<image src="../../../static/wode/arrow_right.png" mode=""></image>
			</view>
		</view>
		<view class="body_item" @tap="toPhoneNumber('email')" v-else>
			<text>邮箱地址</text>
			<view class="body_item_right">
				<text>{{email}}</text>
				<image src="../../../static/wode/arrow_right.png" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loginName:'',
				email:'',
			};
		},
		onShow() {
			var user_info=uni.getStorageSync('user_info');
			this.loginName=user_info.mobile;
			this.email=user_info.mail;
			console.log(this.loginName)
		},
		methods: {
			toPhoneNumber(type) {
				uni.navigateTo({
					url: "../phoneNumber/phoneNumber?type="+type
				})
			},
			tosetPass(){
				uni.navigateTo({
					url: "../setPass/setPass"
				})
			},
			toChangeNum(type){
				uni.navigateTo({
					url:"../changeNumber/changeNumber?type="+type
				})
			},
			back() { //返回
				uni.navigateBack({
					delta: 1
				})
			},
		},
	}
</script>

<style scoped>
	.head {
		width: 100%;
		display: flex;
		justify-content: space-between;
		height: 162upx;
		background: #ffffff;
		padding: 0 24upx;
		z-index: 200;
	}

	.head image {
		width: 20upx;
		height: 36upx;
		margin-right: 9upx;
	}

	.head_left {
		height: 82upx;
		width: 106upx;
		display: flex;
		align-items: center;
		line-height: 82upx;
		color: #666666;
		font-size: 32upx;
		padding-top: 70upx;
	}
	.head_mid{
		padding-top: 90upx;
	}

	.head_right {
		width: 106upx;
	}

	.body_item {
		background: #FFFFFF;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 24upx 24upx;
		font-size: 32upx;
		margin-top: 20upx;
	}

	.body_item image {
		width: 16upx;
		height: 28upx;
		margin-left: 30upx;
	}

	.body_item_right {
		color: #999999;
		font-size: 32upx;
	}
</style>
